import java.io.* ;
import java.lang.* ;

public class Fir {

	public static void main(String[] args) {

		int[] x = {1,2,3,4,5,6,7,8};
		int[] h = {1,1,1,1,1,1};
		int N = h.length;
		int M = x.length;
		int[] y = new int[N+M-1] ;
		int i,j;

		for (j=0 ; j < N-1 ; j++) {
			y[j]=0;
			for(i=0 ; i <= j ; i++) {
				y[j]=y[j]+h[i]*x[j-i];
			}
			System.out.println("Y[" + j + "] is " + y[j]);
		}
		
		for (j=N-1 ; j < M-1 ; j++) {
			y[j]=0;
			for(i=0 ; i < N ; i++) {
				y[j]=y[j]+h[i]*x[j-i];
			}
			System.out.println("Y[" + j + "] is " + y[j]);
		}
		
		for (j = M-1 ; j < M+N-1 ; j++) {
			y[j]=0;
			for(i = j-M+1; i < N ; i++) {
					y[j]=y[j]+h[i]*x[j-i];
			}
			System.out.println("Y[" + j + "] is " + y[j]);
		}
	}


}